<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="javascript:0;">
  <label for="username">USERNAME</label><input type="text" id="username">
  <label for="password">PASSWORD</label><input type="password" id="password">
  <button>添加</button>
</form>
</body>
<script src="/jquery-3.5.1.min.js" type="application/javascript"></script>
<script>
    let user={
        username:$("#username").val(),
        password:$("#password").val(),
    }
    $.post("/addUser",user,function (res) {
        alert("添加成功")
    })
</script>
</html>